<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="angularjs/angular.min.js"></script>
    <script>
        var app = angular.module('myApp',[]);
        app.controller('myController',function ($scope, $http) {
            $scope.list={id:13,rows:[]};
            $scope.pushList=function(){
                $scope.list.rows.push($scope.entity);
                $scope.entity=null;
            }
            $scope.addList = function(){
                $http.post("/addListGoodFormat", $scope.list).success(
                    function(response){
                        alert(response);
                    }
                );
            }
        })
    </script>
</head>

<body ng-app="myApp" ng-controller="myController">
<button ng-click="pushList()">向数组增加一个元素</button>
<br>
姓名<input name="user" ng-model="entity.name">
<br>
年龄<input name="age" ng-model="entity.age">
<table><tr ng-repeat="entity in list.rows">
    <td>{{entity.name}}</td>
    <td>{{entity.age}}</td>
</tr></table>

<button ng-click="addList()">提交到后台保存</button>
</body>

</html>